/**
 * 
 */
package com.sinosoft.perfect.system._roleSystem.dao;

import java.sql.SQLException;
import java.util.List;

import com.sinosoft.perfect.common.system.BaseSqlSessionDaoSupport;
import com.sinosoft.perfect.system._.po.TRoleSystem;
import com.sinosoft.perfect.system._.po.TUserRolesysRelation;
import com.sinosoft.perfect.system._roleSystem.MapperSystemRoleSystem;
import com.sinosoft.perfect.system._roleSystem.vo.AllUsersInOneRoleSystemVO;
import com.sinosoft.perfect.system._roleSystem.vo.RoleSystemVO;

/**
 * @author gaoyan
 * 
 */
public class RoleSystemDAOImpl extends BaseSqlSessionDaoSupport implements IRoleSystemDAO {

	private MapperSystemRoleSystem getMapperSystemRoleBusiness() {
		return getSqlSession().getMapper(MapperSystemRoleSystem.class);
	}

	public int deleteTRoleSystemByPrimaryKey(TRoleSystem troleSystem) throws SQLException {
		return getMapperSystemRoleBusiness().deleteTRoleSystemByPrimaryKey(troleSystem);
	}

	public void deleteTRoleSystemUserByRoleSystemPrimaryKey(TRoleSystem troleSystem) throws SQLException {
		getMapperSystemRoleBusiness().deleteTRoleSystemUserByRoleSystemPrimaryKey(troleSystem);
	}

	public void deleteTRoleSystemUnitByRoleSystemPrimaryKey(TRoleSystem troleSystem) throws SQLException {
		getMapperSystemRoleBusiness().deleteTRoleSystemUnitByRoleSystemPrimaryKey(troleSystem);
	}

	public Object insertByTRoleSystem(TRoleSystem troleSystem) throws SQLException {
		return getMapperSystemRoleBusiness().insertByTRoleSystem(troleSystem);
	}

	public List<TRoleSystem> selectByTRoleSystem(TRoleSystem troleSystem) throws SQLException {
		return getMapperSystemRoleBusiness().selectByTRoleSystem(troleSystem);
	}

	public List<RoleSystemVO> selectTRoleSystemFromUnit(String unitId) throws SQLException {
		return getMapperSystemRoleBusiness().selectTRoleSystemFromUnit(unitId);
	}

	public List<RoleSystemVO> selectTRoleSystemFromUser(String userId) throws SQLException {
		return getMapperSystemRoleBusiness().selectTRoleSystemFromUser(userId);
	}

	public int updateTRoleSystemByPrimaryKey(TRoleSystem troleSystem) throws SQLException {
		return getMapperSystemRoleBusiness().updateTRoleSystemByPrimaryKey(troleSystem);
	}

	public int updateTRoleSystemNotNullByPrimaryKey(TRoleSystem troleSystem) throws SQLException {
		return getMapperSystemRoleBusiness().updateTRoleSystemNotNullByPrimaryKey(troleSystem);
	}

	@Override
	public List<AllUsersInOneRoleSystemVO> selectExitsUsers(TRoleSystem troleSystem) throws SQLException {
		return getMapperSystemRoleBusiness().selectExitsUsers(troleSystem);
	}

	@Override
	public void deleteTUserRoleSystem(TUserRolesysRelation tUserRolesysRelation) throws SQLException {
		getMapperSystemRoleBusiness().deleteTRoleSystemUserByUser(tUserRolesysRelation);
	}

}
